package com.zmn.oms.dubbo.interfaces.zmn.master.order;

import com.zmn.common.dto2.ResponseDTO;
import com.zmn.oms.common.dro.redistribute.WorkRedistributeListItemDRO;
import com.zmn.oms.dubbo.dto.common.work.*;
import com.zmn.oms.dubbo.dto.zmn.order.OrderDetailDRO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * 类描述：师傅工单列表
 *
 * @author heciqi
 * @date 2020/03/27 11:00
 */
public interface MasterWorkListRemoteService {

	/**
	 * 工单详情
	 * @param masterWorkDIO
	 */
	ResponseDTO<WorkDetailDRO> getWorkDetail(MasterWorkDIO masterWorkDIO);

	/**
	 * 工单简版详情
	 * @param masterWorkDIO
	 */
	ResponseDTO<WorkDetailDRO> getSimpleWorkDetail(MasterWorkDIO masterWorkDIO);

	/**
	 * 进行中工单列表
	 *
	 * @param masterWorkDIO
	 */
	ResponseDTO<WorkListDRO> getDoingWork(MasterWorkDIO masterWorkDIO);

	/**
	 * 进行中工单列表
	 *
	 * @param masterWorkDIO
	 */
	ResponseDTO<List<WorkRedistributeListItemDRO>> listRedistributeWork(MasterWorkDIO masterWorkDIO);

	/**
	 * 进行中工单搜索
	 * @param orderListDIO
	 * @return
	 */
	ResponseDTO<WorkListDRO> listDoingWorkByQuery(OrderListDIO orderListDIO);

	/**
	 * 已完成工单列表
	 * @param masterWorkDIO
	 * @return
	 */
	ResponseDTO<WorkListDRO> getCompletedWork(MasterWorkDIO masterWorkDIO);

	/**
	 * 已完成工单列表（新接口）
	 *
	 * @param masterWorkDIO
	 * @return
	 */
	ResponseDTO<List<WorkListItemDRO>> listCompletedWork(MasterWorkDIO masterWorkDIO);

	/**
	 * 历史工单详情
	 * @param masterWorkDIO
	 */
	ResponseDTO<WorkDetailDRO> getHisWorkDetail(MasterWorkDIO masterWorkDIO);

	/**
	 * 获取工单可派单工程师列表
	 * @param masterWorkDIO
	 */
	ResponseDTO<WorkDistributeMasterDRO> getWorkDistributeMasterList(MasterWorkDIO masterWorkDIO);

	/**
	 * 用户报价显示相关信息
	 * @param quotationShowDIO
	 */
	ResponseDTO<WorkQuotationShowDRO> getQuotationShow(BaseRequestDIO quotationShowDIO);

	/**
	 * 获取工单保修卡二维码
	 * @param masterWorkDIO
	 */
	ResponseDTO<MasterWorkWarrantyDRO> getWorkWarranty(MasterWorkDIO masterWorkDIO);

	/**
	 * 获取工单上门二维码
	 * @param masterWorkDIO
	 */
	ResponseDTO<MasterWorkVisitQrCodeDRO> getWorkVisitQrCode(MasterWorkDIO masterWorkDIO);

	/**
	 * 获取最大优惠金额
	 * @param getMaxDiscountDIO
	 */
	ResponseDTO<Integer> getMaxDiscount(BaseRequestDIO getMaxDiscountDIO);

	/**
	 * 获取最大定金金额
	 *
	 * @param getMaxDiscountDIO
	 */
	ResponseDTO<Integer> getMaxDepositAmount(BaseRequestDIO getMaxDiscountDIO);

	/**
	 * 是否存在工程师订单（JST聚合塔服务调用）
	 * @param masterId 工程师id
	 * @param leaveStartTime 请假开始时间
	 * @param leaveEndTime 请假结束时间
	 */
	ResponseDTO<Boolean> existEngineerOrder(Integer masterId, Date leaveStartTime, Date leaveEndTime);

	/**
	 * 工单列表搜索
	 *
	 * @param orderListDIO
	 * @see MasterWorkListRemoteService#listDoingWorkByQuery(com.zmn.oms.dubbo.dto.common.work.OrderListDIO)
	 */
	@Deprecated
	ResponseDTO<WorkListDRO> listPageOrder(OrderListDIO orderListDIO);

	/**
	 * 报价产品记录
	 *
	 * @param orderId
	 */
	ResponseDTO<String> queryProductRecord(Long orderId);

	/**
	 * 工单照片配置
	 *
	 * @param orderAttachmentDIO
	 */
	@Deprecated
	ResponseDTO<List<OrderAttachmentDRO>> queryOrderAttachment(OrderAttachmentDIO orderAttachmentDIO);

    /**
     * 获取是否能报价和是否可以申请优惠信息
     *
	 * @param baseRequestDIO
     * @return
     */
	ResponseDTO<MasterQuotationDiscountDRO> getQuotationAndDiscountInfo(BaseRequestDIO baseRequestDIO);

	/**
	 * 查询工程师订单数量
	 *
	 * @param engineerId
	 * @param startTime
	 * @param endTime
	 */
	@ApiOperation(value = "根据师傅id查询其工单数量", response = ResponseDTO.class)
	ResponseDTO<OrderCountDRO> queryOrderCount(@ApiParam(value = "工程师id", required = true) Integer engineerId,
										@ApiParam(value = "起始时间") Date startTime, @ApiParam(value = "结束时间") Date endTime);

	/**
	 * 师傅订单操作检查
	 *
	 * @param baseRequestDIO
	 */
	@ApiOperation(value = "根据订单ID获取订单师傅操作检查信息", response = ResponseDTO.class)
	ResponseDTO<MasterWorkOperateCheckInfoDRO> getMasterWorkOperateCheckInfo(@ApiParam(value = "工单ID", required = true) BaseRequestDIO baseRequestDIO);


	/**
	 * 批量查询工单详情-投诉列表使用
	 *
	 * @param ids
	 */
	@ApiOperation(value = "批量查询工单详情", response = ResponseDTO.class)
	ResponseDTO<List<OrderDetailDRO>> getOrderDetailList(List<Long> ids);

	/**
	 * 师傅订单操作检查
	 *
	 * @param orderId
	 * @param operateId
	 */
	@ApiOperation(value = "根据订单ID和操作ID获取订单操作结果", response = ResponseDTO.class)
	ResponseDTO<String> getOperateResult(@NotNull Long orderId, @NotNull Integer operateId);

	/**
	 * 根据工程师最近三个月失败订单的取消缘由id
	 *
	 * @param engineerId
	 */
	@ApiOperation(value = "根据工程师最近三个月失败订单的取消缘由id", response = ResponseDTO.class)
	ResponseDTO<List<Integer>> getCancelReasonIdByEngineerId(@ApiParam(value = "工程师id", required = true) Integer engineerId);

	/**
	 * 查询进行中已完成已领单的工单
	 * @param masterId
	 * @return
	 */
	@ApiOperation(value = "根据工程师查询进行中的工单列表", response = ResponseDTO.class)
	ResponseDTO<WorkListDRO> listDoingWork(Integer masterId);

	/**
	 * 根据工程师指定预约时间内的工单ID集合
	 *
	 * @param engineerId
	 * @param startTime
	 * @param endTime
	 */
	@ApiOperation(value = "根据工程师指定预约时间内的工单ID集合", response = ResponseDTO.class)
	ResponseDTO<List<Long>> getOrderIdListByEngineerIdAndDutyTime(@ApiParam(value = "工程师id", required = true) @NotNull(message = "工程师ID不能为空") Integer engineerId,
																  @ApiParam(value = "预约开始时间", required = true) @NotNull(message = "预约开始时间不能为空") Date startTime,
																  @ApiParam(value = "预约结束时间", required = true) @NotNull(message = "预约结束时间不能为空") Date endTime);
}
